{% extends "forum/base.html" %}
{% load i18n %}

{% block body %}
<form action="{% url forum_search %}" method="get">
    <div class="clearfix">        
        <input class="text" style="float:right; margin:0px;" name="search" type="text"></input>
        <button style="float:right;">{% trans "Search" %}</button>
    </div>
</form>

<div class="clearfix">
    {% if page.has_previous %}
    <div style="float:left">
        <a href="?page=1">&lt;&lt;</a>
        <a href="?page={{ page.previous_page_number }}">&lt;</a>
    </div>
    {% endif %}
    {% if page.has_next %}
    <div style="float:right">
        <a href="?page={{ page.next_page_number }}">&gt;</a>
        <a href="?page={{ paginator.num_pages }}">&gt;&gt;</a>
    </div>
    {% endif %}
</div>

{% if page.object_list %}

<table>
    <thead>
        <tr>
            <th style="width:50%">{% trans "Subject" %}</th>
            <th>{% trans "Author" %}</th>
            <th>{% trans "Last Modified" %}</th>
        </tr>
    </thead>
    <tbody>
    {% for item in page.object_list %}
    <tr>
        <td><a href="{{ item.link }}">{{ item.title }}</a></td>
        <td>{{ item.author }}</td>
        <td>{{ item.modified|date:"D d M \de Y" }}</td>
    </tr>
    {% endfor %}
    </tbody>
</table>
{% else %}
<div class="notice">{% trans "Your search returned no results." %}</div>
{% endif %}

<div class="clear">        
    {% if page.has_previous %}
    <div style="float:left">
        <a href="?page=1">&lt;&lt;</a>
        <a href="?page={{ page.previous_page_number }}">&lt;</a>
    </div>
    {% endif %}
    {% if page.has_next %}
    <div style="float:right">
        <a href="?page={{ page.next_page_number }}">&gt;</a>
        <a href="?page={{ paginator.num_pages }}">&gt;&gt;</a>
    </div>
    {% endif %}
</div>

{% endblock %}